<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['namespace' => 'API', 'prefix' => 'auth'], function () {
    Route::post('login', 'AuthController@login');
});
Route::group(['namespace' => 'API', 'middleware' => ['auth:api']], function () {

    //获取当前登录人的个人信息
    Route::get('admin/profile', 'AdminController@getProfile');
    Route::post('admin/profile', 'AdminController@updateProfile');
    Route::post('admin/reset-password/{id}', 'AdminController@resetPassword');
    Route::resource('admin', 'AdminController');
    Route::resource('financial-staff', 'FinancialStaffInfoController');
    Route::resource('judicial-officers', 'JudicialOfficersInfoController');
    Route::resource('mediator', 'MediatorInfoController');
    Route::resource('organization', 'OrganizationInfoController');
    Route::resource('case', 'CaseController');

    Route::resource('investigation', 'InvestigationAgreementController');
    Route::resource('mediation-record', 'MediationRecordController');
    Route::resource('return-visit-record', 'ReturnVisitRecordController');
    Route::resource('permissions', 'RoleController');
    Route::resource('training-application','TrainingApplicationController');
    Route::resource('organization-commendation','OrganizationCommendationStatisticsController');
    Route::resource('mediator-commendation','MediatorCommendationStatisticsController');
    Route::resource('funding-protection','FundingProtectionStatisticsController');
    Route::resource('laws','LawsController');
    Route::post('law-input','LawsController@input');
    Route::post('explain-input','JudicialInterpretationController@input');
    Route::resource('judicial-interpretation','JudicialInterpretationController');


    Route::resource('case-statistics','CaseStatisticsController');
    Route::resource('classic-case','ClassicCaseController');
    Route::resource('subsidy-accounting','SubsidyAccountingController');

    Route::resource('subsidy-application','SubsidyApplicationController');
    Route::get('put-accounting/{id}','SubsidyApplicationController@putAccounting');
    Route::get('shenpi/{id}','SubsidyAccountingController@shenpi');
    Route::resource('training-situation','TrainingSituationController');
    Route::group(['prefix' => 'data'], function () {
        Route::get('organization-list', 'DataProviderController@organizationList');
        Route::get('mediator-list', 'DataProviderController@mediatorList');
        Route::get('permission-list', 'DataProviderController@permissionList');
        Route::get('laws/{type}', 'DataProviderController@getLaws');
    });
});
